package com.niodata.dp.web.module.task;

import com.niodata.dp.web.module.task.TaskGraph.NodeEdge;
import com.niodata.dp.web.module.task.TaskGraph.TaskNode;
import java.util.List;
import java.util.Map;

public class TaskDumpGraph {

  private String taskId;
  private String taskName;
  private String scheduleCron;
  private String description;
  private Map<String, String> taskParams;
  private List<TaskNode> nodes;
  private List<NodeEdge> edges;
  private String concurrentOption;
  private boolean delProtection;

  public static TaskDumpGraph buildFromTaskGraph(TaskGraph graph) {
    TaskDumpGraph dump = new TaskDumpGraph();
    dump.scheduleCron = graph.getScheduleCron();
    dump.concurrentOption = graph.getConcurrentOption();
    dump.delProtection = graph.isDelProtection();
    dump.description = graph.getDescription();
    dump.edges = graph.getEdges();
    dump.nodes = graph.getNodes();
    dump.taskId = graph.getTaskId();
    dump.taskName = graph.getTaskName();
    dump.taskParams = graph.getTaskParams();
    return dump;
  }

  public String getTaskId() {
    return taskId;
  }

  public void setTaskId(String taskId) {
    this.taskId = taskId;
  }

  public String getTaskName() {
    return taskName;
  }

  public void setTaskName(String taskName) {
    this.taskName = taskName;
  }

  public String getScheduleCron() {
    return scheduleCron;
  }

  public void setScheduleCron(String scheduleCron) {
    this.scheduleCron = scheduleCron;
  }

  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

  public Map<String, String> getTaskParams() {
    return taskParams;
  }

  public void setTaskParams(Map<String, String> taskParams) {
    this.taskParams = taskParams;
  }

  public List<TaskNode> getNodes() {
    return nodes;
  }

  public void setNodes(List<TaskNode> nodes) {
    this.nodes = nodes;
  }

  public List<NodeEdge> getEdges() {
    return edges;
  }

  public void setEdges(List<NodeEdge> edges) {
    this.edges = edges;
  }

  public String getConcurrentOption() {
    return concurrentOption;
  }

  public void setConcurrentOption(String concurrentOption) {
    this.concurrentOption = concurrentOption;
  }

  public boolean isDelProtection() {
    return delProtection;
  }

  public void setDelProtection(boolean delProtection) {
    this.delProtection = delProtection;
  }
}
